<template>
  <div>
	  <van-nav-bar
	    title="设置"
	    left-arrow
	    @click-left="onClickBack"
	  />
	  <div class="title pt-1 pb-1 pl-1">账号管理</div>
	  <van-cell title="个人资料" is-link to="index" />
	  <van-cell title="收货地址" is-link to="/addresslist" />
	  <div class="title pt-1 pb-1 pl-1">关于</div>
	  <van-cell title="关于商城" is-link to="index" />
	  <van-cell title="意见反馈" is-link to="index" />
	  <van-cell title="协议规则" is-link to="index" />
	  <van-cell title="资质证件" is-link to="index" />
	  <van-cell title="用户协议" is-link to="index" />
	  <van-cell title="隐私政策" is-link to="index" />
	  <div class="pt-1 pl-1 pr-1 pb-1">
		   <button @click="loginOut" class="w-100 pt-1 pb-1 text-center btn">退出登录</button>
	  </div>
  </div>
</template>
<script>
import { mapMutations }  from 'vuex'
import  api  from '../lib/api'
export default{
    methods:{
        ...mapMutations(['loginout']),
        loginOut(){
            api.post('/logout',{checkToken:true}).then(res=>{
                   this.loginout();
                  if(res.msg==='ok'){
                      this.$router.replace({
                            name:"Login"
                      })
                  }
            })
        },
		onClickBack(){
			 this.$router.go(-1) 
		}
    }
}
</script>
<style scoped>
	.title{
		background-color: #F5F5F5;
		color:#333333;
	}
	html,body{
		height: 100%;
	    background-color: #F5F5F5;
	}
	.btn{
		font-size: 18px;
		border:none;
		border-radius: 5px;
	}
</style>

